﻿	      <?php include("../common/conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	public $title;
	public $price;
	public $images;
	public $yuanjia;
	public $goodsid;
	public $reply;
	public $xiaoliang;
	public $summary;

	function __construct($title,$price,$images,$yuanjia,$goodsid,$reply,$xiaoliang,$summary)
	{
		$this->title      = $title;
		$this->price = $price;
		$this->images     = $images;
		$this->yuanjia      = $yuanjia;
		$this->goodsid    = $goodsid;
		$this->reply    = $reply;
		$this->xiaoliang    = $xiaoliang;
		$this->summary    = $summary;
	}
}

if($_REQUEST['page']!="")
{
$de=$_REQUEST['page']*$_REQUEST['pagesize'];
$size=$_REQUEST['pagesize'];
}

else
{
$de=0;
$size=5;
}


     $sj=1;
    
	$rert30=mysql_query("select *from goods  where  shopid ='".$_REQUEST[shopid]."' and shangjia='".$sj."' and `check`=1 order by goodsid desc limit $de,$size");
	
	$prize = array();
	
	while($rowf=mysql_fetch_array($rert30)){
	
	
	
	$image = explode(',', $rowf['images']);

	if ($image[$rowf[defaultImgOrd]] !='') {
		$defaultImg = $image[$rowf[defaultImgOrd]];
	}else{
		$defaultImg = $image[0];
	}

			$prize[] = new MyPrizeBean($rowf['title'],$rowf['price'],$defaultImg,$rowf['yuanjia'],$rowf['goodsid'],$rowf['replynumber'],$rowf['xiaoliang'],$rowf['summary']);
		

	}

echo json_encode($prize);


?>